/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package xenon3d.scene;

import javax.media.opengl.GL2;

/**
 * An enumeration of all Xenon3D primitive types.
 *
 * @author Volker Everts
 * @version 0.1 - 30.07.2008: Created
 * @version 0.2 - 04.09.2011: Adapted
 */
public enum PrimType {

    /** Vertices are rendered as single points. Each vertex makes up one point. */
    Points (GL2.GL_POINTS),

    /** Vertices are rendered as single lines. Each 2 vertices make up one line. */
    Lines (GL2.GL_LINES),

    /** Vertices are rendered as connected line segments. Each vertex adds a new line segment. */
    LineStrip (GL2.GL_LINE_STRIP),

    /** Vertices are rendered as connected line segments. Each vertex adds a new
     *  line segment. The first and last vertex elements are connected, too. */
    LineLoop (GL2.GL_LINE_LOOP),

    /** Vertices are rendered as single triangles. Each 3 vertices make up one triangle. */
    Triangles (GL2.GL_TRIANGLES),

    /** Vertices are rendered as a strip of connected triangles. Each vertex
     *  after the 3rd adds a new triangle to the strip. */
    TriangleStrip (GL2.GL_TRIANGLE_STRIP),

    /** Vertices are rendered as a fan of connected triangles. Each vertex
     *  after the 3rd adds a new triangle to the fan. */
    TriangleFan (GL2.GL_TRIANGLE_FAN),

    /** Vertices are rendered as single quads. Each 4 vertices make up one quad. */
    Quads (GL2.GL_QUADS),

    /** Vertices are rendered as a strip of connected quads. Each 2 vertices
     *  after the 4th adds a new quad to the strip. */
    QuadStrip (GL2.GL_QUAD_STRIP),

    /** Vertices are rendered as one planar polygon. Each vertex adds an edge to
     *  the polygon. */
    Polygon (GL2.GL_POLYGON);

    /** The OpenGL constant for the specific primitive type. */
    private int value;

    /**
     * Creates a PrimType enumeration element.
     * @param value the OpenGL constant for the specific primitive type
     */
    PrimType(int value) {
        this.value = value;
    }

    /**
     * Returns the OpenGL constant for the specific primitive type.
     * @return the primitive type constant
     */
    public int value() {
        return value;
    }

} // end enum PrimType